package com.feng.controller;

import com.feng.entity.RestResponse;
import com.feng.entity.vo.AddCommentVo;
import com.feng.service.CommentService;
import com.feng.utils.Const;
import org.springframework.web.bind.annotation.*;

/**
 * (Comment)表控制层
 *
 * @author feng
 * @since 2024-11-05 21:33:35
 */
@RestController
@RequestMapping("/api/comment")
public class CommentController {


    final
    CommentService commentService;

    public CommentController(CommentService commentService) {
        this.commentService = commentService;
    }

    @GetMapping("/commentList")
    public RestResponse commentList(String articleId, Integer pageCurrent, Integer pageSize){
        return commentService.commentList(Const.ZERO, articleId, pageCurrent, pageSize);
    }

    @PostMapping("/addComment")
    public RestResponse addComment(@RequestBody AddCommentVo addComment){
        return commentService.addComment(addComment);
    }

}

